package com.itheima.demo;

import java.util.ArrayList;
import java.util.Collections;

public class Demo_Stream002 {
    public static void main(String[] args) {
        //stream终结方法练习;
        //forEach();
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list,1,2,3,4,6);
        list.stream().forEach(s-> System.out.println(s));
        //count();方法;
        System.out.println(list.stream().count());
    }
}
